<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->

    <title>发送新闻稿</title>

    <!-- Bootstrap core CSS -->
    <link href="css/bootstrap.min.css" rel="stylesheet">

    <style>
        #textarea_editor {
            overflow: scroll;
            max-height: 300px
        }
    </style>

</head>

<%
    String user = (String) request.getSession().getAttribute("user");
    if (user == null || user.equals("")) {
        response.sendRedirect("/index");
    }
%>
<body>
<!-- page header start-->
<nav class="navbar navbar-inverse navbar-fixed-top">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"
                    aria-expanded="false" aria-controls="navbar">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="index">主页</a>
        </div>
        <div id="navbar" class="collapse navbar-collapse">
            <ul class="nav navbar-nav navbar-right">
                <%
                    user = (String) request.getSession().getAttribute("user");
                    if (user == null || user.equals("")) {
                %>
                <li><a href="login.jsp">登录</a></li>
                <li><a href="register.jsp">注册</a></li>
                <%
                } else {
                %>
                <li><a href=""><%=request.getSession().getAttribute("user")%>
                </a></li>
                <li><a href="edit.jsp">发新闻稿</a></li>
                <%
                    if ((boolean) request.getSession().getAttribute("manager")) {
                %>
                <li><a href="manager.jsp">管理</a></li>
                <%
                    }
                %>
                <li><a href="logout">退出</a></li>
                <%
                    }
                %>
            </ul>
        </div><!--/.nav-collapse -->
    </div>
</nav>
<!-- page header end-->


<div class="container" style="padding: 88px 0 0">

    <div class="row">
        <div class="panel panel-default">
            <div class="panel-heading">新闻稿编辑</div>

            <div class="panel-body">
                <form action="edit" method="post" enctype="multipart/form-data">
                    <div class="control-group col-md-4 col-sm-4 col-lg-4">
                        <label class="control-label" style="padding-top: auto">*标题:</label>
                        <div class="controls">
                            <input type="text" class="span3" name="title" style="height: auto">
                        </div>
                    </div>
                    <div class="control-group col-md-4 col-sm-4 col-lg-4">
                        <label class="control-label" style="padding-top: auto">*撰稿人:</label>
                        <div class="controls">
                            <input type="text" class="span3" name="contributor" style="height: auto">
                        </div>
                    </div>
                    <div class="control-group col-md-4 col-sm-4 col-lg-4">
                        <label class="control-label" style="padding-top: auto">*撰稿时间:</label>
                        <div class="controls">
                            <input type="date" class="span3" name="feedTime" style="height: auto">
                        </div>
                    </div>
                    <div class="control-group col-md-12">
                        <label class="control-label" style="padding-top: auto"><br><br>*内容:</label>
                        <div class="controls controls-sm">
                            <textarea class="textarea_editor span12" rows="15"
                                      style="width: 100%;min-height:15em;min-width:100%;max-width:100%;padding: 1em"
                                      name="main"
                                      placeholder="输入正文 ..."></textarea>
                        </div>
                    </div>

                    <br><br>
                    <div class="control-group col-md-12">
                        <label class="control-label" style="padding-top: 20px">官网链接:</label>
                        <div class="controls">
                            <input type="text" class="span3" name="link_content" style="height: auto">
                        </div>
                    </div>
                    <div class="control-group col-md-12 " style="padding:8px 0 0">
                        <br><br>
                        <span class="pull-left">上传文件:</span>
                        <input type="file" multiple class="file-loading pull-left" name="file"/>
                        <button type="submit" class="btn btn-primary pull-right">提交</button>
                        <label for="favoritefood">&nbsp;&nbsp;&nbsp;*奖项类别:</label>
                        <select id="favoritefood" class="form-controli pull-center" style="width:200px" name="type">
                            <option value="type_01">普通</option>
                            <option value="type_02">科技类</option>
                            <option value="type_03">院级</option>
                            <option value="type_04">省级</option>
                            <option value="type_05">国家级</option>
                        </select>
                        <br><br>
                        <p style="color: red;">* 友情提示：照片中的身份证号等敏感信息注意打码以防信息泄露</p>
                    </div>
                </form>
            </div>
        </div>

    </div>
</div>

</div> <!-- /container -->


<script src="js/jquery-3.3.1.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>
